#ifndef PLUGIN_HPP
#define PLUGIN_HPP

#include <string>
#include "ConfigDLL.h"

#ifdef BOARDHELL_WINDOWS
    #include <windows.h>
#endif

#ifdef BOARDHELL_LINUX
    #include <dlfcn.h>
#endif

/*!
 * \namespace application
 * \brief This namespace gather the classes related to application
 */
namespace application
{

/*! \class Plugin
*   \brief Class to load extern DLL
*/
template<typename T>
class Plugin
{
    private:
        #ifdef BOARDHELL_WINDOWS
            HMODULE _library;
        #endif

        #ifdef BOARDHELL_LINUX
            void* _library
        #endif

        typedef T* (*PtrFunc)();
        T* _object;

    public:
        Plugin();
        ~Plugin();

        T* loadPlugin(const std::string& name_plugin);
};

}

#include "Plugin.inl"

#endif  // PLUGIN_HPP
